package com.yedou.mapper;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yedou.entity.po.People;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface PeopleMapper extends BaseMapper<People> {

    void savePeople(People people);

    People queryUserById(long id);

    List<People> queryUserByIds(List<Long> listId);

    void updateUser(People people);

    void deleteUser(long id);

    List<People> findName();

    void updateByName();

    void updateByIds(@Param("list") List<Long> ids);

    void updateBalanceByIds(@Param("ew") UpdateWrapper<People> wrapper,
                            @Param("amount") int amount);

//    @Update("update user set balance = balance - #{money} where id = #{id}")
    void deductBalance(Long id,@Param("remainBalance") Integer money);

    List<People> queryPeoples(String name,
                              Integer status,
                              Integer minBalance,
                              Integer maxBalance);
}
